import 'package:flutter/foundation.dart';
import '../models/member.dart';

class AuthProvider with ChangeNotifier {
  Member? _currentUser;

  Member? get currentUser => _currentUser;
  bool get isLoggedIn => _currentUser != null;
  bool get isAdmin => _currentUser?.role == MemberRole.admin;
  bool get isMember => _currentUser?.role == MemberRole.member;
  bool get isGuest => _currentUser == null || _currentUser?.role == MemberRole.guest;

  void setCurrentUser(Member? user) {
    _currentUser = user;
    notifyListeners();
  }

  void logout() {
    _currentUser = null;
    notifyListeners();
  }
} 